package com.qf.feign.api;

import com.baomidou.mybatisplus.plugins.Page;
import com.qf.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "shop-user", path = "/user")
public interface UserService {

    @RequestMapping("/addUser")
    public Boolean addUser(@RequestBody User user);

    @RequestMapping("/getUserById/{id}")
    public User getUserById(@PathVariable Integer id);

    @RequestMapping("/updateUser")
    public Boolean updateUser(@RequestBody User user);

    @RequestMapping("/getUserPage")
//    public Page<User> getUserPage(@RequestBody Page<User> page,@RequestBody User user);
    public Page<User> getUserPage(@RequestBody Map<String, Object> map);

    @RequestMapping("/deleteUserById/{id}")
    public Boolean deleteUserById(@PathVariable Integer id);

    @RequestMapping("/batchDelUser")
    void batchDelUser(List<Integer> userIds);

    @RequestMapping("/findUser")
    User findUser(@RequestParam("field") String field, @RequestParam("value") String value);

}
